/**
 * Sample React Native App
 * https://github.com/facebook/react-native
 * @flow
 */

import React, {Component} from 'react';
import {
  StyleSheet,
  Text,
  View,
  Platform,
} from 'react-native';

import AMap from 'react-native-smart-amap';

export default class App extends Component {


  render() {
    return (
      <View style={styles.container}>
        <Text style={styles.link}>查看地图</Text>

        <AMap
          ref={ component => this._amap = component }
          style={{flex: 1,}}
          options={{
            frame: {
              width: 300,
              height: 400,
            },
            showsUserLocation: true,
            showTraffic: true,
            userTrackingMode: Platform.OS === 'ios' ? AMap.constants.userTrackingMode.none : null,
            centerCoordinate: {
              latitude: 40.00,
              longitude: 160.00,
            },
            zoomLevel: 18.1,
            centerMarker: Platform.OS === 'ios' ? 'icon_location' : 'poi_marker',
          }}
        />
      </View>
    );
  }
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    justifyContent: 'center',
    alignItems: 'center',
    backgroundColor: '#F5FCFF',
  },
  welcome: {
    fontSize: 20,
    textAlign: 'center',
    margin: 10,
  },
  instructions: {
    textAlign: 'center',
    color: '#333333',
    marginBottom: 5,
  },
  link: {
    color: 'blue',
    fontSize: 18,
    marginTop: 30,
  },
});
